home *** CD-ROM | disk | FTP | other *** search
/ Crosscountry USA Photo Safari / Crosscountry USA Photo Safari.iso / Data / cc_base / pak00_16bit_f.pk3 / help.gl.p < prev    next >
Text File  |  2002-12-23  |  5KB  |  141 lines

  1. {
  2.  
  3.   Hidden = TRUE;
  4.   
  5.   ChildID = {
  6.     GuiAnimation("background") {
  7.       AnimationID = "image/help.pcx";
  8.       X = 0;
  9.       Y = 0;
  10.       },  
  11.         GuiTextInput("screen_name") {
  12.       X = 30;
  13.       Y = 40;
  14.           Width = 50;
  15.           Height = 20;
  16.           FontID = "font/verdana_9.tf";
  17.       InputDisabled = TRUE;      
  18.           InputText = Mangle(322/*"Help"*/);
  19.         },
  20.     GuiListbox("list_topic") {
  21.         X = 20;
  22.         Y = 61;
  23.         Height = 397;
  24.         Width  = 172;
  25.         ListHilightedColor = #8EC2E3;
  26.             FontID = "font/arial_black_14.tf";
  27.   
  28.         StrListID = StrList {
  29.           Size = 10240;
  30.         };
  31.   
  32.           ScriptID = script {
  33.             @setup { /* load all help topics */        
  34.             str     topic;
  35.             int     totalrow_count;
  36.             int     row_count;
  37.             
  38.             resid   help_data;                   
  39.                 
  40.             help_data = ResPropGetResID(ResByName("CSVData"),"help_id"); 
  41.             totalrow_count = CSVGetRowCount(help_data);
  42.             GuiListboxClear(SELF);
  43.             while (row_count < totalrow_count) {
  44.               topic = CSVGetStr(help_data, "menu_topic", row_count); 
  45.               GuiListboxAppend(SELF, topic);
  46.               row_count+=1;
  47.             }              
  48.             }
  49.             @loaded{ /* display help description initially */
  50.               ResParseEvent(SELF, "@activate");
  51.             }
  52.             @activate{
  53.               str   selected_topic; 
  54.               str   getTopic;
  55.               str   description;
  56.               str   help_picture;
  57.               int   get_row;
  58.               resid Player;
  59.             resid help_data; 
  60.               
  61.                 Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
  62.             help_data = ResPropGetResID(ResByName("CSVData"),"help_id"); 
  63.               selected_topic = GuiListboxGetSelected(SELF);
  64.             
  65.             get_row = CSVSearch(help_data, "menu_topic", selected_topic);           
  66.             description = CSVGetStr(help_data, "description", get_row);
  67.             help_picture = CSVGetStr(help_data, "image", get_row);
  68.             if (!(StrExact(help_picture, ""))) {      /* load picture, max image size is 422*389 */  
  69.               ResPropSetInt(GuiChildByName(SELF,"help_picture/help_pic"),"Hidden", FALSE);
  70.               ResPropSetStr(GuiChildByName(SELF,"Description"),"InputText", ""); 
  71.               help_picture = StrFormatStr("csv_data/help/%s", help_picture);
  72.               Release("help_picture");
  73.               Mark("help_picture");              
  74.               ResPropSetResID(GuiChildByName(SELF,"help_picture/help_pic"), "AnimationID", ResByName(help_picture));                            
  75.               ResPropSetInt(GuiChildByName(SELF,"Description"),"Hidden", TRUE);  
  76.             } else if (!(StrExact(description, ""))) {
  77.               ResPropSetInt(GuiChildByName(SELF,"Description"),"Hidden", FALSE);  
  78.               ResPropSetStr(GuiChildByName(SELF,"Description"),"InputText", description);  
  79.               ResPropSetInt(GuiChildByName(SELF,"help_picture/help_pic"),"Hidden", TRUE);
  80.             }
  81.             }
  82.             
  83.         };
  84.   
  85.         ChildID = {
  86.           GuiScrollBar ("sb") {
  87.             Kind = VERTICAL;
  88.             ChildID = {
  89.               GuiButton("thumb") {
  90.                 StyleID = "gui/laptop/scrollbar/sb_thumb.gbs";
  91.               },
  92.               GuiButton("dec") {
  93.                 StyleID = "gui/laptop/scrollbar/sb_uarrow.gbs";
  94.               },
  95.               GuiButton("inc") {
  96.                 StyleID = "gui/laptop/scrollbar/sb_darrow.gbs";
  97.               }
  98.             };
  99.           },
  100.           GuiLayer("help_picture") {
  101.             X = 175;
  102.             Y = 5;
  103.             Hidden = FALSE;
  104.             ChildID = {
  105.                   GuiAnimation("help_pic") {
  106.                     X = 0;
  107.                     Y = 0;
  108.                     }
  109.             };
  110.           },
  111.           GuiTextInput("Description") {
  112.                 X = 172;
  113.                 Y = 0;
  114.                 Width = 429;
  115.                 Height = 397;  
  116.                 WordWrap = TRUE;
  117.             InputDisabled = TRUE;               
  118.                 FontID = "font/arial_black_14.tf";
  119.                 InputText = 11264:"";
  120.                 ChildID = {
  121.                   GuiScrollBar ("sb") {
  122.                 Kind = VERTICAL;
  123.                 ChildID = {
  124.                   GuiButton("thumb") {
  125.                     StyleID = "gui/laptop/scrollbar/sb_thumb.gbs";
  126.                   },
  127.                   GuiButton("dec") {
  128.                     StyleID = "gui/laptop/scrollbar/sb_uarrow.gbs";
  129.                   },
  130.                   GuiButton("inc") {
  131.                     StyleID = "gui/laptop/scrollbar/sb_darrow.gbs";
  132.                   }
  133.                 };
  134.               }
  135.                 };  /* END OF DESCRIPTION CHILDID */
  136.           }
  137.         };  /* END OF GUILISTBOX SCRIPT */
  138.       }     /* END OF GUILISTBOX */
  139.   };
  140. }
  141.